package cn.tedu.medicalappointmentsystemk.dao.persist.repository.impl;

import cn.tedu.medicalappointmentsystemk.dao.persist.mapper.ScheduleMapper;
import cn.tedu.medicalappointmentsystemk.dao.persist.repository.ScheduleRepository;
import cn.tedu.medicalappointmentsystemk.pojo.bo.ScheduleSelectAllBO;
import cn.tedu.medicalappointmentsystemk.pojo.bo.ScheduleSelectBO;
import cn.tedu.medicalappointmentsystemk.pojo.po.SchedulePO;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public class ScheduleRepositoryImpl implements ScheduleRepository {
    @Autowired
    private ScheduleMapper scheduleMapper;
    @Override
    public String selectDutyShift(Long doctorId, Date createDate) {
        return scheduleMapper.selectDutyShift(doctorId,createDate);
    }

    @Override
    public Integer insert(SchedulePO po) {
        return scheduleMapper.insert(po);
    }

    @Override
    public Page<ScheduleSelectBO> selectByDateList(List<Date> dateList) {
        return scheduleMapper.selectByDateList(dateList);
    }

    @Override
    public Page<ScheduleSelectAllBO> selectAll() {
        return scheduleMapper.selectAll();
    }

    @Override
    public Integer deleteById(Long id) {
        return scheduleMapper.deleteById(id);
    }

    @Override
    public Page<ScheduleSelectAllBO> searchLastMonth() {
        return scheduleMapper.searchLastMonth();
    }

    @Override
    public Page<ScheduleSelectAllBO> searchLastWeek() {
        return scheduleMapper.searchLastWeek();
    }

    @Override
    public Page<ScheduleSelectAllBO> searchToday() {
        return scheduleMapper.searchToday();
    }

    @Override
    public List<ScheduleSelectAllBO> selectByNickname(String nickname) {
        return scheduleMapper.selectByNickname(nickname);
    }
}
